package Simulator;

public class Block {
	int id;
	int state;
	String tag;
	String data;
	boolean used; // only for 2way set associative cache

	public Block(Block block) {
		this.state = block.state;
		this.tag = block.tag;
		this.data = block.data;
		this.used = block.used;
		this.id = block.id;
	}

	public Block(int id, int state, String tag, String data, boolean used) {
		this.id = id;
		this.state = state;
		this.tag = tag;
		this.data = data;
		this.used = used;

	}

	public Block(int state, String tag, String data, int id) {
		this.state = state;
		this.tag = tag;
		this.data = data;
		this.used = false;
		this.id = id;
	}

	/*
	 * state 1 - M state 2 - S state 3 - I
	 */
	@Override
	public String toString() {
		return "ID: " + id + " STATE: " + state + " TAG: " + tag + " DATA: "
				+ data + " USED: " + used;
	}
}
